package com.shy.dao;

import com.shy.pojo.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: shy
 * @Date: 2020/11/05/20:54
 * @Description:
 */
public interface UserMapper {

    @Select("select * from user")
    List<User> getUsers();

    // 方法存在多个参数，所有参数必须加上Param注解
    @Select("select * from user where id=#{id}")
    User getUserById(@Param("id")int id);

    // !!!
    @Delete("delete from user where id=#{uid}")
    int deleteUser(@Param("uid")int id);

}
